<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<c:if test="${sessionScope.usuario == null or sessionScope.usuario.nombreUsuarioWeb != 'Alumno'}">
    <c:redirect url="/dinamica/ingresar.jsp" />
</c:if>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Asistencia</title> 

<link rel="stylesheet" type="text/css" href="/SistemaWebAGB_2.0/dinamica/css/960.css" />
<link rel="stylesheet" type="text/css" href="/SistemaWebAGB_2.0/dinamica/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/SistemaWebAGB_2.0/dinamica/css/text.css" />
<link rel="stylesheet" type="text/css" href="/SistemaWebAGB_2.0/dinamica/css/blue.css" />
<link rel="stylesheet" type="text/css" href="/SistemaWebAGB_2.0/dinamica/css/BlockUi.css" />
<link type="text/css" href="/SistemaWebAGB_2.0/dinamica/css/smoothness/ui.css" rel="stylesheet" />
    <script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/jquery-1.6.2.min.js"></script>
    <script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/blend/jquery.blend.js"></script>
    <script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/ui.core.js"></script>
	<script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/ui.sortable.js"></script>    
    <script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/ui.dialog.js"></script>
    <script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/ui.datepicker.js"></script>
    <script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/effects.js"></script>
    
    <script type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/flot/jquery.flot.pack.js"></script>
   
    
    <!--[if IE]>
    <script language="javascript" type="text/javascript" src="/SistemaWebAGB_2.0/dinamica/js/flot/excanvas.pack.js"></script>
    <![endif]-->
	<!--[if IE 6]>
	<link rel="stylesheet" type="text/css" href="/SistemaWebAGB_2.0/dinamica/css/iefix.css" />
	<script src="/SistemaWebAGB_2.0/dinamica/js/pngfix.js"></script>
    <script>
        DD_belatedPNG.fix('#menu ul li a span span');
    </script>        
    <![endif]-->
    <script language="javascript" src="/SistemaWebAGB_2.0/dinamica/js/jquery.blockUI.js"></script>
    <script language="javascript">
        $(document).ready(function(){
            
            
              $('.button').click
              (
                    function()
                {
                    
                    var periodo=$('.smallInput option:selected').val();
                    
                    if(periodo==-1)
                    {
                       
                        
                        $.growlUI('Error', 'Por Favor Seleccionar un Mes.!'); 
                       
                    }
                    else
                    {
                        //var usuario=$('#usuario').text();
                        
                        $.ajax(
                                {
                                   url: "/SistemaWebAGB_2.0/SrvServletAlumnos",
                                   type: "POST",
                                   data: 
                                    { 
                                        accion: "asistenciaCalendario", 
                                        cboPeriodo: periodo,
                                        anio:"2012"//
                                    },
                                   cache:false,
                                   success: function(response, textStatus, jqXHR)
                                   {
                                       $('#box-table-a tbody').empty();
                                       $('#box-table-a').hide();
                                                        var valor=0,a=0,f=0,j=0,t=0;
                                                      //  alert("Response :"+response+"-Otro: "+jqXHR)
                                                      var lista=jQuery.parseJSON(response);
                                                        if(lista.length!=0)
                                                        {
                                                        var inicio =lista[lista.length-1].inicio -1;
                                                             var val=0;
                                                           //   alert(response);
                                                             

                                                             //alert(lista.length);
                                                             var total="";
                                                           <c:forEach var="sem"  begin="1" end="5">
                                                             
                                                                   total+="<tr>";   
                                                               
                                                                 for(var i=1;i<=5;i++)
                                                                 {
                                                                    
                                                                        if(i<=inicio)
                                                                        {
                                                                          
                                                                         total+="<td>&nbsp;</td>";
                                                                   
                                                                        }

                                                                     if(i>inicio)
                                                                     {

                                                                         if(lista.length-1<=valor)
                                                                         {
                                                                            total+="<td>&nbsp;</td>";
                                                                         }
                                                                         else
                                                                         {
                                                                             var bgcolor="";
                                                                             if(lista[valor].estado_asistencia=="A")
                                                                             {
                                                                                  a++;
                                                                                 // bgcolor = "asistir";
                                                                                 bgcolor="#DAF4F8";
                                                                              }
                                                                              if(lista[valor].estado_asistencia=="F")
                                                                              {
                                                                                  f++;
                                                                                 // bgcolor = "faltar";
                                                                                 bgcolor="#FDC6CF"
                                                                              }
                                                                              if(lista[valor].estado_asistencia=="J")
                                                                              {
                                                                                  j++;
                                                                                 // bgcolor = "justificar";
                                                                                 bgcolor="#9EE4CA";
                                                                              }
                                                                              if(lista[valor].estado_asistencia=="T")
                                                                              {
                                                                                  t++;
                                                                                //  bgcolor = "tarde";
                                                                                bgcolor="#B4B4B4";
                                                                                  
                                                                              }
                                                                               total+="<td align=center style='background:"+bgcolor+"'>"+lista[valor].dia+"/"+lista[valor].mes+"<br/>"+lista[valor].estado_asistencia+"</td>";
                                                                               valor++;
                                                                         }
                                                                     }
                                                                    
                                                                        
                                                                  
                                                                    }
                                                                      inicio=0;
                                                                     total+="</tr>";
                                                            </c:forEach>  




                                                         //    alert("llega?"+total);

                                                              $('#box-table-a tbody').append(total);
                                                              $('#box-table-a').fadeIn('slow');

                                                        }

                                                          else
                                                           {
                                                              $('.formulario').append("<div style=color:red> No se encontro nada");
                                                           }
                                   }
                                     
                        
                                }
                               );
                              
                    
                   }
            
            });
      }); 
      

    </script>
</head>

<body>
<!-- WRAPPER START -->
<div class="container_16" id="wrapper">	
<!-- HIDDEN COLOR CHANGER -->      
      <div style="position:relative;">
      	<div id="colorchanger">
        	<a href="dashboard_red.html"><span class="redtheme">Red Theme</span></a>
            <a href="dashboard.html"><span class="bluetheme">Blue Theme</span></a>
            <a href="dashboard_green.html"><span class="greentheme">Green Theme</span></a>
        </div>
      </div>
  	<!--LOGO-->
	<div class="grid_8" id="logo">Intranet - Alexander Graham Bell</div>
    <div class="grid_8">
<!-- USER TOOLS START -->
      <div id="user_tools"><span>Bienvenido(a) <a href="#" id="usuario">${sessionScope.nombre}</a>   |  <a href="/SistemaWebAGB_2.0/Salir">Salir</a></span></div>
    </div>
<!-- USER TOOLS END -->    
<div class="grid_16" id="header">
<!-- MENU START -->
<div id="menu">
	<ul class="group" id="menu_group_main">
		<li class="item first" id="one"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=conceptos" class="main"><span class="outer"><span class="inner dashboard">Aula Virtual</span></span></a></li>
                <li class="item middle" id="two"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=horario" class="main"><span class="outer"><span class="inner content">Horario</span></span></a></li>
                <li class="item middle" id="three"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=comboPeriodoMes"><span class="outer"><span class="inner reports png">Notas</span></span></a></li>
                <li class="item middle" id="four"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=asistenciaCalendario" class="main current"><span class="outer"><span class="inner users">Asistencias</span></span></a></li>
		<li class="item middle" id="five"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=publicacionesBuscar" class="main"><span class="outer"><span class="inner media_library">Biblioteca</span></span></a></li>        
		<li class="item middle" id="six"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=comuActividad" class="main"><span class="outer"><span class="inner event_manager">Comunicados</span></span></a></li>        
		<li class="item middle" id="seven"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=descargaArticulo" class="main"><span class="outer"><span class="inner newsletter">Descargas</span></span></a></li>        
		<li class="item last" id="eight"><a href="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=configuracion" class="main"><span class="outer"><span class="inner settings">Configuracion</span></span></a></li>                
    </ul>
</div>
<!-- MENU END -->
</div>

<div class="grid_16">
<!-- TABS START -->
    <div id="tabs">
         <div class="container">
            <ul>
                      <li><a href="#" class="current"><span>Asistencia</span></a></li>
                              
           </ul>
        </div>
    </div>
<!-- TABS END -->    
</div>
<!-- HIDDEN SUBMENU START -->
<div class="grid_16" id="hidden_submenu">
    <ul class="more_menu">
    <li><a href="#">More link 1</a></li>
    <li><a href="#">More link 2</a></li>  
      <li><a href="#">More link 3</a></li>    
        <li><a href="#">More link 4</a></li>                               
      </ul>
    <ul class="more_menu">
    <li><a href="#">More link 5</a></li>
    <li><a href="#">More link 6</a></li>  
      <li><a href="#">More link 7</a></li> 
        <li><a href="#">More link 8</a></li>                                  
      </ul>
    <ul class="more_menu">
    <li><a href="#">More link 9</a></li>
    <li><a href="#">More link 10</a></li>  
      <li><a href="#">More link 11</a></li>  
        <li><a href="#">More link 12</a></li>                                 
      </ul>            
  </div>
<!-- HIDDEN SUBMENU END -->  

<!-- CONTENT START -->
    <div class="grid_16" id="content">
    <!--  TITLE START  --> 
    <div class="grid_9">
    <h1 class="Nota">Asistencia</h1>
    </div>
    <!--RIGHT TEXT/CALENDAR-->

    <!--RIGHT TEXT/CALENDAR END-->
    <div class="clear">
    </div>
    <!--  TITLE END  -->    
<!-- #PORTLETS START -->
    <div id="portlets">
    <!-- FIRST SORTABLE COLUMN START -->
      <!--THIS IS A PORTLET-->
      <!--THIS IS A PORTLET-->
        <div class="portlet">
    

    <div class="portlet-content">
     
          <div class="contentplace">
        
  <div class="topplace">
  <img src="/SistemaWebAGB_2.0/dinamica/images/NoBVcpE-0.png" alt="" width="28" height="28" class="placeborder" style="display: none" />
  </div>
          <div id="filter" style="margin: 0 auto;width: 850px;  ">

    

      <h3 ><img src="/SistemaWebAGB_2.0/dinamica/images/Icon_Lupa.gif"  width="29px" height="29px"/>Seleccione Mes</h3>

      <form id="form1" name="form1" method="post" action="/SistemaWebAGB_2.0/SrvServletAlumnos?accion=asistenciaCalendario" >
  <table width="90%" border="0" align="center">
  <tr>
    <td width="5%">&nbsp;</td>
    <td>Nivel</td>
    <td><input type="text" class="smallInput" value="${requestScope.info.nivel}" ></td>
    <td>&nbsp;</td>
    <td>A&ntilde;o</td>
    <td><input type="text" class="smallInput" value="${requestScope.info.anioMatriculas}" ></td>
    <td>&nbsp;</td>
     <td>Grado</td>
    <td><input type="text" class="smallInput" value="${requestScope.info.grado}"></td>
    <td width="1%">&nbsp;</td>
  </tr>

  <tr>
    <td>&nbsp;</td>
    <td>Seccion</td>
    <td><input type="text" class="smallInput"  value="${requestScope.info.seccion}"></td>
    <td>&nbsp;</td>
    <td>Mes</td>
    <td><select class="smallInput" >
               <option value="-1">Seleccionar Mes</option>
                <option value="2">Marzo</option>
                <option value="3">Abril</option>
                <option value="4">Mayo</option>
                <option value="5">Junio</option>
                <option value="6">Julio</option>
                <option value="7">Agosto</option>
                <option value="8">Setiembre</option>
                <option value="9">Octubre</option>
                <option value="10">Noviembre</option>
                <option value="11">Diciembre</option>
        </select></td>
    <td>&nbsp;</td>
    
    
     <td>&nbsp;</td>
    <td> <span > <a class="button"><span>Consultar Asistencia</span></a></span></td>
    <td></td>
    <td>&nbsp;</td>
  </tr>
</table>
            </form>  
            
    
   
          </div>
         <div class="bottomplace">
  <img  src="/SistemaWebAGB_2.0/dinamica/images/wjkwwT0-3.png" alt="" width="28" height="28" class="placeborder" style="display: none" />
  </div>
</div>
    </div>
        </div>
      <!-- FIRST SORTABLE COLUMN END -->
      <!-- SECOND SORTABLE COLUMN START -->
  <!--  SECOND SORTABLE COLUMN END -->
    <div class="clear"></div>
    <!--THIS IS A WIDE PORTLET-->
    <div class="portlet" >
        <div class="portlet-header fixed"><img src="/SistemaWebAGB_2.0/dinamica/images/icons/user.gif" width="16" height="16" alt="Latest Registered Users"> Asistencia</div>
    <div class="portlet-content nopadding" >
        <form action="" method="post" class="formulario" >
          <table class="ocultar"width="100%" cellpadding="0" cellspacing="0" id="box-table-a" summary="Employee Pay Sheet">
            <thead>
              <tr>
                
                <th align="center" width="126" scope="col">Lunes</th>
                <th width="115" scope="col">Martes</th>
                <th width="149" scope="col">Mi&eacute;rcoles</th>
                <th width="131" scope="col">Jueves</th>
                <th width="163" scope="col">Viernes</th>
                
               
              
              </tr>
            </thead>
            <tbody>
           <!--    <tr>
              
                <td>&Aacute;lgebra</td>
                  <td>20</td>
               
                <td>sddf</td>
                <td>sdf</td>
                <td>asd</td>
             
              </tr>
             -->
            </tbody>
          </table>
        </form>
    </div>
      </div>
<!--  END #PORTLETS -->  
   </div>
    <div class="clear"> </div>
<!-- END CONTENT-->    
  </div>
<div class="clear"> </div>

     <!-- This contains the hidden content for modal box calls -->
    <div class='hidden'>
      <div id="inline_example1" title="This is a modal box" style='padding:10px; background:#fff;'>
      <p><strong>This content comes from a hidden element on this page.</strong></p>
                  
      <p><strong>Try testing yourself!</strong></p>
            <p>You can call as many dialogs you want with jQuery UI.</p>
      </div>
    </div>
</div>
<!-- WRAPPER END -->
<!-- FOOTER START -->
<div class="container_16" id="footer">
 <a href="../index.htm">I. E. Alexander Graham Bell</a></div>
<!-- FOOTER END -->
</body>
</html>
